#include "logger.h"

Logger::Logger()
{

}

Logger::Logger(QStringListModel *m,  QListView *v)
{
    model = m;
    log   = v;
}

void Logger::print(QString s)
{
    QDateTime time = QDateTime::currentDateTime();
    QString str = time.toString("yyyy-MM-dd hh:mm:ss");
    str = "["+str+"] ";
    list << str + s;
    model->setStringList(list);
    log->setModel(model);
}

void Logger::write(QString s)
{

}
